package com.qf.crud.common;
import lombok.Data;

@Data
public class R {
    private String code;
    private String msg;
    private Object data;
    public static R ok(Object data){
        R r = ok();
        r.setData(data);
        return r;
    }

    public static R ok(){
        R r = new R();
        r.setCode("200");
        r.setMsg("操作成功");
        return r;
    }
    public static R error(String msg){
        R r = new R();
        r.setCode("500");
        r.setMsg(msg);
        return r;
    }
    public static R error(){
        R r = new R();
        r.setCode("500");
        r.setMsg("操作失败");
        return r;
    }
}